package com.komodo.island.gdx;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class BubbleNotif {

	public TextureRegion notif;
	SpriteBatch batch;

	int interval;
	
	public float x;
	public float y;
	float width;
	float height;

	double starTime;
	double currTime;

	boolean isShow = false;

	public BubbleNotif(SpriteBatch batch, TextureRegion notif, float x,
			float y, float width, float height) {
		// TODO Auto-generated constructor stub
		this.batch = batch;
		this.notif = notif;
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.interval = 300;

	}
	public BubbleNotif(SpriteBatch batch, TextureRegion notif, float x,
			float y, float width, float height, int interval) {
		// TODO Auto-generated constructor stub
		this.batch = batch;
		this.notif = notif;
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.interval = interval;

	}

	public void draw() {

		if (!isShow) {
//			starTime = System.currentTimeMillis();
		} else {
			currTime = System.currentTimeMillis();
			if (currTime - starTime <= 300) {
				batch.begin();
				try{
				batch.draw(notif, x, y);
				}catch(Exception e){
					
				}
				batch.end();
			}else{
				isShow= false;
			}
		}
	}
	public void show(){
		isShow = true;
		starTime = System.currentTimeMillis();
	}

}
